/*
* Copyright (c) 2009, Active Web Solutions Limited
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1- Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2- Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3- The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY Active Web Solutions Limited ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL Active Web Solutions Limited BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.aws.jazure.httpconstants;

/**
 * Interface that holds constant values for Blob Blocks
 * 
 * @author dyaa.albakour
 *
 */
public interface BlobBlockConstants {

	
	final int KB = 1024;
	final int MB = 1024*KB;	
	
	
	/**
	 * When transmitting a blob that is larger than this constant, this library automatically
     * transmits the blob as individual blocks. I.e., the blob is (1) partitioned
     * into separate parts (these parts are called blocks) and then (2) each of the blocks is
     * transmitted separately.
     * The maximum size of this constant as supported by the real blob storage service is currently
     * 64 MB; the development storage tool currently restricts this value to 2 MB.
     * Setting this constant can have a significant impact on the performance for uploading or
     * downloading blobs.
     * As a general guideline: If you run in a reliable environment increase this constant to reduce
     * the amount of roundtrips. In an unreliable environment keep this constant low to reduce the
     * amount of data that needs to be retransmitted in case of connection failures.
	 */
	public static final int MaximumBlobSizeBeforeTransmittingAsBlocks = 2*MB;
	
	
	/**
	 * The size of a single block when transmitting a blob that is larger than the 
	 * MaximumBlobSizeBeforeTransmittingAsBlocks constant (see above).
	 * The maximum size of this constant is currently 4 MB; the development storage
	 * tool currently restricts this value to 1 MB.
	 * Setting this constant can have a significant impact on the performance for uploading or
	 * downloading blobs.
	 * As a general guideline: If you run in a reliable environment increase this constant to reduce
	 * the amount of roundtrips. In an unreliable environment keep this constant low to reduce the 
	 * amount of data that needs to be retransmitted in case of connection failures. 
	 */
	public static final int BlockSize = 1*MB;
	
}
